package com.tanhua.manage.handler;

import com.tanhua.domain.vo.PageResult;
import com.tanhua.dubbo.api.PublishApi;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Component;

@Component
public class VerifyPublishHandler implements PublishHandler{
    @Reference
    private PublishApi publishApi;
    //自己的操作类型
    private final Integer TYPE = 0;

    /**
     * 是否由该处理器处理
     * @param type
     */
    @Override
    public boolean shouldHandler(Integer type) {
        return TYPE.equals(type);
    }

    /**
     * 执行待审核动态的查询
     * @param page
     * @param pagesize
     * @param state
     */
    @Override
    public PageResult handle(Integer page, Integer pagesize, Integer state) {
       return publishApi.queryPublishListByState(page,pagesize,state);
    }
}